package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 标签列表请求参数类
 *
 * @author hongyuhao
 * @version 2014年3月15日 - 上午9:58:28
 */
public class TagBaseInfoListRequest extends Request {

	private static final long serialVersionUID = -9202410285833153238L;
	
	private String tagType;
	private String parentTagType;
	private int sex;
	private int age;

	public String getTagType() {
		return tagType;
	}

	public void setTagType(String tagType) {
		this.tagType = tagType;
	}
	
	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getParentTagType() {
		return parentTagType;
	}

	public void setParentTagType(String parentTagType) {
		this.parentTagType = parentTagType;
	}

	/** */
	public TagBaseInfoListRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.tagType = requestInfo.getParameter(ApiUrlParamEnum.tagType.getParamName());
		this.parentTagType = requestInfo.getParameter(ApiUrlParamEnum.parentTagType.getParamName(), "");
		this.sex = requestInfo.getIntParameter(ApiUrlParamEnum.sex.getParamName(),-1);
		this.age = requestInfo.getIntParameter(ApiUrlParamEnum.age.getParamName(), -1);
		
	}
	
}
